home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / comm / misc / DragonDaemon.lha / DragonDaemon-Install / ADM / DragonDial2.adm < prev    next >
Text File  |  1999-07-10  |  3KB  |  108 lines

  1. /* $VER: DragonDial.adm 0.7 (20.04.99)
  2.  
  3.    (C) 1999 by J.Reinert alias "Techno"  ac-techno@t-online.de
  4.  
  5.    Start von DrageonDaemon und Portabfrage hinzugefügt
  6.    Telefonnummer auswahlrequester hinzugefügt und
  7.    alle Buchstaben etc. entfernen lassen
  8.    07.06.99 Volker Weber
  9.  
  10.  
  11.    Wählt die Telefonnummer des markierten Datensatzes über
  12.    eine angeschlossene DataBox "Speed Dragon" an.
  13.  
  14.    Voraussetzung:   - Installiertes ADM (Adressenverwaltung)
  15.                     - Installiertes und konfiguriertes "DragonTools"
  16.                     - DataBox "Speed Dragon" (von Hagenuk)
  17.                     (- aktives Commoditie "DragonDaemon")
  18.  
  19. */
  20.  
  21. OPTIONS RESULTS
  22.  
  23. /* ***** Argument Port abfragen und auf Gültigkeit testen */
  24.  
  25. arg port
  26.  
  27. if (port ~= 1) & (port ~= 2) & (port ~= 3) then port = ""
  28.  
  29.  
  30. /* ***** DragonDaemon bei Bedarf starten */
  31.  
  32. if ~ show('P','DragonDaemon') then do
  33.  
  34.    address command "run >nil: DragonDaemon"
  35.    address command "waitforport DragonDaemon"
  36.  
  37. end
  38.  
  39. /* ----- Prüfen, ob DragonDaemon läuft */
  40.  
  41. if show('P','DragonDaemon') then do
  42.  
  43. /* ----- RexxReqtools-Library öffnen */
  44.  
  45.   IF ~SHOW("L","rexxreqtools.library") THEN CALL ADDLIB("rexxreqtools.library",0,-30,0)
  46.  
  47. /* ----- Aktuellen Datensatz holen */
  48.  
  49.   GETADDRESS ADM EXTFILE    
  50.  
  51. /* ----- Telefonnummern holen */
  52.  
  53.   Phone=ADM.TELEPHONE
  54.  
  55. /* ***** bie mehreren Nummern die gewünschte abfragen */
  56.  
  57.   if pos('|',phone) > 0 then do
  58.     Tags = "rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext"
  59.     Info = "Bitte die gewünschte Nummer auswählen!"
  60.     button = phone || '|_Abbruch'
  61.     erg = rtezrequest(Info,button,,Tags)
  62.  
  63.     if erg = 0 then exit
  64.  
  65.     if erg = 1 then
  66.         phone = substr(phone,1,pos('|',phone)-1)
  67.     else do
  68.         do for erg-1
  69.             phone = substr(phone,pos('|',phone)+1)
  70.         end
  71.         if pos('|',phone) > 0 then
  72.             phone = substr(phone,1,pos('|',phone)-1)
  73.     end
  74.   end
  75.  
  76. /* ***** unerlaubte Zeichen entfernen */
  77.   
  78.   Phone= COMPRESS(Phone,' /-,.!"§$%&()=?\*+^#_:;<>{}~@abcdefghijklmnopqrstuvwxyzäüöABCDEFGHIJKLMNOPQRSTUVWXYZÄÜÖ')
  79.  
  80.  
  81. /* ----- DragonDaemon addressieren */
  82.   
  83.   Address "DragonDaemon"
  84.   
  85. /* ----- Nummer wählen */
  86.   
  87.   DD_DIALNUMBER Phone  port
  88.  
  89. /* ----- Auf Fehler prüfen */   
  90.  
  91.   if result="ERROR" then do
  92.     Tags = "rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext"
  93.     Info = "Nummer wurde nicht gewählt!"
  94.     dummy=rtezrequest(Info,"Okay",,Tags)
  95.   end
  96.  
  97. end
  98. else do
  99.  
  100. /* ----- Fehler, "DragonDaemon" läuft nicht*/
  101.  
  102.   Tags = "rt_reqpos=reqpos_centerscr rtez_flags=ezreqf_centertext"
  103.   Info = "'DragonDaemon' ist noch nicht aktiv!" '0a'x "und konnte nicht gestartet werden"
  104.   dummy=rtezrequest(Info,"Okay",,Tags)
  105. end
  106. EXIT
  107.  
  108.